<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title><?php echo ($title); ?></title>
  <meta name="description" content="这是一个 help 页面">
  <meta name="keywords" content="help">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" /> 
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" type="text/css" href="/blog/Public/assets/css/amazeui.min.css" />
  <link rel="stylesheet" type="text/css" href="/blog/Public/assets/css/admin.css" />
  <script type="text/javascript" src="/blog/Public/assets/js/jquery.min.js"></script>
   <script type="text/javascript" src="/blog/Public/assets/js/amazeui.min.js"></script>
</head>
<body>
<header class="am-topbar am-topbar-inverse admin-header">
  <div class="am-topbar-brand">
    <strong>小草——</strong> <small>blog后台管理系统</small>
  </div>
  <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
  <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
    <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">   
    <?php if(empty($_SESSION['name'])): ?><li><a href="<?php echo U('Member/login');?>"><span class="am-icon-user"></span> 登录</a></li>
          <li><a href="<?php echo U('Member/reg');?>"><span class="am-icon-pencil"></span> 注册</a></li>  
    <?php else: ?>
     <li><a href="<?php echo U('Member/login');?>"><span class="am-icon-user"></span>  欢迎您：<?php echo (session('name')); ?></a></li>
          <li><a href="<?php echo U('Member/logout');?>"><span class="am-icon-sign-out"></span>注销</a></li><?php endif; ?>                                    
    </ul>
  </div>
</header>

<div class="am-cf admin-main">
  <!-- sidebar start -->
  <div class="admin-sidebar am-offcanvas am-dh">
    <div class="am-offcanvas-bar admin-offcanvas-bar">
      <ul class="am-list admin-sidebar-list">
       <li><a href="<?php echo U('index/view');?>"><span class="am-icon-home"></span> 博客首页</a></li>
       <li><a href="<?php echo U('Articletype/view');?>"><span class="am-icon-navicon"></span> 博客分类</a></li>
       <li><a href="<?php echo U('Article/view');?>"><span class="am-icon-file"></span> 博客文章</a></li>
       <li><a href="<?php echo U('Master/view');?>"><span class="am-icon-user"></span> 博主基本资料</a></li>
       <li><a href="<?php echo U('Photo/view');?>"><span class="am-icon-camera"></span> 博客相册</a></li> 
       <li><a href="<?php echo U('Friend/view');?>"><span class="am-icon-users"></span> 博客朋友</a></li>
       <li><a href="<?php echo U('Runtime/view');?>"><span class="am-icon-close"></span> 清理缓存</a></li>                                                   
      </ul>
       <div class="am-panel am-panel-default admin-sidebar-panel">
        <div class="am-panel-bd">
          <p><span class="am-icon-bookmark"></span> 公告</p>
          <p>时光静好，与君语；细水流年，与君同。—— 小草</p>
        </div>
      </div>

      <div class="am-panel am-panel-default admin-sidebar-panel">
        <div class="am-panel-bd">
          <p><span class="am-icon-tag"></span> wiki</p>
          <p>Welcome to the 小草 bolog!</p>
        </div>
      </div>   
    </div>
  </div>
  <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content">
  
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf">
          <strong class="am-text-primary am-text-lg">博客文章列表</strong> /
          <small>blogarticlelist</small>
        </div>
      </div>
      <hr/>

     
<link rel="stylesheet" type="text/css" href="/blog/Public/assets/css/tp.css" />
<style>
.am-table{
	font-size:13px;
}
</style>
<script>
function alls(){		
	var sum = document.getElementsByName("select[]");		
	for(var i=0;i<sum.length;i++){ 		
	if(sum[i].type=="checkbox"){ 		
	sum[i].checked = true ; 
	
       }
	
    }
	
}

function unalls(){		
	var sum = document.getElementsByName("select[]");		
	for(var i=0;i<sum.length;i++){ 		
	if(sum[i].type=="checkbox"){ 	
	sum[i].checked = false ; 		
   	   }
	
    }
	
}

function resets(){
		var sum = document.getElementsByName("select[]");
		for(var i=0;i<sum.length;i++){ 
		if(sum[i].type=="checkbox"){
			
		if(sum[i].checked==true){ 
		sum[i].checked = false; 
		}else{ 
		sum[i].checked = true;
		
	      }
	  
		}
		
	  }
}


</script>

<form  action="<?php echo U('Article/deleteall');?>" method="post">
<table class="am-table am-table-compact am-table-centered am-scrollable-horizontal   am-table-bordered"> 
<div class="am-btn-toolbar" style="margin-top:-20px;padding:5px 0;">
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" class="am-btn am-btn-default" onclick="alls()"><span class="am-icon-check"></span> 全选</button>
              <button type="button" class="am-btn am-btn-default" onclick="unalls()"><span class="am-icon-close"></span> 不全选</button>
              <button type="button" class="am-btn am-btn-default" onclick="resets()"><span class="am-icon-close"></span> 反选</button>
              <button type="submit" class="am-btn am-btn-default" ><span class="am-icon-close"></span>批量删除</button>
            </div>
    </div>    	 
    <thead>
        <tr>
            <th>选择</th>
            <th>id</th>
            <th>缩略图</th>
            <th>博客分类</th>                
            <th>博客标题</th> 
            <th>博客简介</th>          
            <th>浏览次数</th>
            <th>是否显示</th>
            <th>发布者</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
    <?php if(is_array($Artinfo)): $i = 0; $__LIST__ = $Artinfo;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
           <td><input class="select" id="select[]" type="checkbox" name="select[]"  value='<?php if(!empty($Artinfo)): echo ($vo["article_id"]); endif; ?>' /></td>	  	   
            <td><?php echo ($i); ?></td>
             <td>
             <img src="/blog/<?php echo ($vo["article_img"]); ?>" width="50" height="30"/>
             </td> 
          
             <td>
             <?php echo ($vo["articletype_name"]); ?>
             </td>
	            <td>
	            <div class="am-text-truncate" style="width: 100px;"><?php echo ($vo["article_title"]); ?></div>
	            </td>
	             <td>
	            <div class="am-text-truncate" style="width: 100px;"><?php echo ($vo["article_info"]); ?></div>
	            </td>            
             <td><?php echo ($vo["article_count"]); ?></td> 
             <td><?php echo ($vo["article_show"]); ?></td>
             <td><?php echo ($vo["article_mastername"]); ?></td> 
            <td>
            <a href="<?php echo U('Article/edit?article_id='.$vo['article_id']);?>" class="am-btn am-btn-primary am-btn-xs">
                                   编辑
            </a>
            <a  onclick='return del("<?php echo ($vo["article_id"]); ?>")'  class="am-btn am-btn-warning am-btn-xs">删除 </a>           
            </td>
        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
    </tbody>     
</table>
 </form>
	<div class="am-g">
	        <a href="<?php echo U('Article/add');?>">
	            <button class="am-btn am-btn-primary am-btn-sm"><?php echo ($info); ?></button>
	         </a>
	</div>
	
<div class="am-g am-text-center">
	       <?php echo ($page); ?>
	</div>

 <script type="text/javascript" src="/blog/Public/layer/layer.js"></script>
<script type="text/javascript">
function del(article_id){
	layer.confirm('您确定要删除这条数据吗？', {
	btn: ['确定','取消']
	}, function()
	{
	$.ajax({
	url: "/blog/index.php/Admin/Article/delete",
	type: "get",
	data:{"article_id":article_id},
	dataType: "json",
	beforeSend:function(){
		layer.msg('正在删除', {
			  icon: 16
			  ,shade: 0.01
			});
	},
	success: function(data){
	if(data.state==1){
	location.href = location.href;
	layer.msg(data.msg, {icon: 6});
	}else{
	layer.msg(data.msg, {icon: 5});
	}
	},
	error:function(){
		layer.msg('服务异常！');
	}
	
	});


	});
	}
	

</script> 	 
  
  
  

   



 </div>
    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </footer>
  </div>
  <!-- content end -->



</div>



</body>
</html>